package com._方法;

import java.util.Scanner;
public class Test10 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i + 1) + "个整数");
            arr[i] = sc.nextInt();
        }
        int[] arr1 = arr(arr);
        System.out.println("最大值:" + arr1[0]);
        System.out.println("最小值:" + arr1[1]);
    }

    public static int[] arr(int[] arr) {

        //打擂台变量
        int c = arr[0];
        int d = arr[0];
        for (int i = 0; i < arr.length; i++) {
            //最大值
            if (c < arr[i]) {
                c = arr[i];
            }
            //最小值
            if (d > arr[i]) {
                d = arr[i];
            }
        }

        int[] arr1 = {c, d};
        return arr1;

    }
}